package lab_4;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.ejb.Stateful;

/**
 *
 * @author grp02 - Pascal Charreix and Meike Paetz
 *
 * This is the implementation for SmartTours' contingent object
 */
@Stateful(mappedName = "grp02/SmartToursContingentBean")
public class SmartToursContingentBean implements SmartToursContingent {

    private int singleBookedRoom;
    private int familyBookedRoom;
    private String travelAgencyName;

    /**
     *
     * This is to get information about how many single rooms are booked
     */
    public int getSingleBookedRoom() {
        return singleBookedRoom;
    }

    /**
     *
     * This is to get information about how many family rooms are booked 
     */
    public int getFamilyBookedRoom() {
        return familyBookedRoom;
    }

    /**
     *
     * This is to get information about by which travel agency the room is
     * booked
     */
    public String getTravelAgencyName() {
        return travelAgencyName;
    }

    /**
     *
     * This is to initialize the object with information about a new contingent
     * from the hotel operator
     */
    @PostConstruct
    public void initialize(int single, int family, String name) {
        singleBookedRoom = single;
        familyBookedRoom = family;
        travelAgencyName = name;
    }
}
